package com.example.cshaoshao.testall.activities;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.example.cshaoshao.testall.R;
import com.example.cshaoshao.testall.entities.MyUrl;

import fm.jiecao.jcvideoplayer_lib.JCVideoPlayer;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        JCVideoPlayerStandard jcVideoPlayerStandard = (JCVideoPlayerStandard) findViewById(R.id.videoplayer);
        jcVideoPlayerStandard.setUp(MyUrl.URL, JCVideoPlayer.SCREEN_LAYOUT_NORMAL,"吃土豆");
    }

    @Override
    public void onBackPressed() {
        if(JCVideoPlayer.backPress())
        {
            return;
        }
        super.onBackPressed();
    }

    @Override
    protected void onPause() {
        super.onPause();
        JCVideoPlayer.releaseAllVideos();
    }
}
